/*
 * Copyright 2001 Alexander Boverman and the original authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _WT_SETTINGS_H
#define _WT_SETTINGS_H

#include "WtContext.h"

typedef enum WtOptionCodeT
{
  WT_UNKNOWN_OPTION,
  WT_SERVER_REUSE_INTERP,
  WT_SERVER_DELETE_INTERP,
  WT_SERVER_TASK_NAMESPACE,
  WT_SERVER_INIT_INTERP_SCRIPT,
  WT_SERVER_LOAD_PACKAGES_SCRIPT,
  WT_SERVER_START_WORKER_SCRIPT,
  WT_SERVER_CREATE_INTERP_SCRIPT,
  WT_SERVER_START_REQUEST_SCRIPT,
  WT_SERVER_END_REQUEST_SCRIPT,
  WT_SERVER_ERROR_SCRIPT,
  WT_SERVER_REST_INTERP_SCRIPT,
  WT_SERVER_DELETE_INTERP_SCRIPT,
  WT_SERVER_END_WORKER_SCRIPT,
  WT_SERVER_INCLUDE_START_SCRIPT,
  WT_SERVER_INCLUDE_END_SCRIPT,
  WT_SERVER_INCLUDE_NAMESPACE,
  WT_SERVER_ADD_HEADER_TRAILER,
  WT_SERVER_INCLUDE_HEADER,
  WT_SERVER_INCLUDE_TRAILER,
  WT_SERVER_SCRIPT_START_STRING,
  WT_SERVER_SCRIPT_END_STRING,
  WT_SERVER_INTERPOLATE_TEXT,
  WT_SERVER_PAGE_TEXT_HANDLER,
  WT_SERVER_PAGE_EXPR_HANDLER,
  WT_SESSION_HANDLER,
  WT_SESSION_HANDLER_TYPE,
  WT_SESSION_COOKIE_NAME,
  WT_SESSION_MAX_IDLE_TIME,
  WT_SESSION_SWEEP_FREQUENCY,
  WT_DB_SESSION_HANDLER,
  WT_DATA_SOURCE_HANDLER
} WtOptionCode;

void WtInitOptionCodes(WtContext *w);
WtOptionCode WtGetOptionCode(const char *key, WtContext *w);
Tcl_Obj *WtGetOptionKey(WtOptionCode code, WtContext *w);
int WtInitDefaultContextSettings(WtContext *w);
int WtInitWebSettings(WtContext *w, Tcl_Obj *settings, Tcl_Interp *interp);
int WtInitWebSetting(WtContext *w, const char *key, Tcl_Obj *val,
  Tcl_Interp *interp);
int WtDeleteOptionKeys(Tcl_HashTable *optionKeys);

#endif /* ! _WT_SETTINGS_H */
